﻿//
// Created by Administrator on 2020/9/23.
//
#include <iostream>

int sum(std::initializer_list<int> lst) {
    int result = 0;
    for (int val: lst) {
        result += val;
    }
    return result;
}

int main() {

    int result = sum({
                             1, 2, 3, 4, 5, 6, 7, 8, 9
                     });

    std::cout << "sum:" << result << std::endl;

    return 0;
}